package com.ruoyi.lvlian.controller;

import com.openapi.sdk.service.DataExchangeService;

import java.util.HashMap;
import java.util.Map;
//正式环境地址
//用户名：3e5d4f2a-9331-478e-b1b4-e05699b02de2
// 密码：niJ65Sj396O2GVR344zj85aC8Na5RK
// 私钥：17abebe3-526e-4814-bd82-8eef9b92a35e
// clientId：2cc006db-d680-49bb-b827-e87e2946f2e7

public class TestZhongJiao {
    public static void main(String[] args) {
        {


            Map<String, String> map = new HashMap<String, String>(3);
            map.put("cid", "223be5c3-2637-4f31-b881-53f527ba47b3");
            //私钥用于 SDK 生成签名，不会在请求中传输
            map.put("srt", "28bf5da4-fabb-44d1-90b4-c8330c9d7e6c");
            map.put("vclN", "鲁FBC522"); //车牌号中间无空格
            map.put("vco", "2"); //车牌号中间无空格
            map.put("timeNearby", "72");
            map.put("qryBtm", "2025-02-05 10:39:50");
            map.put("qryEtm", "2025-02-05 11:22:00");

            String url = "https://openapi.sinoiov.cn/save/apis/routerPath";
            String res = null;
            try {
                DataExchangeService des = new DataExchangeService(5000, 8000);
                // 通过https方式调用!此方法内部会使用私钥生成签名参数 sign,私钥不会发送
                res = des.postHttps(url, map);
            } catch (Exception e) {
                System.out.println(  e);
            }
             System.out.println(  res);

        }
    }
}
